package com.xrkj.miniprogram.server.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xrkj.miniprogram.server.entity.DigitalDevice;
import com.xrkj.miniprogram.server.mapper.DigitalDeviceMapper;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;


@Service
public class QueryInformationService {
    @Autowired
    private DigitalDeviceMapper mapper;

    public List<DigitalDevice> getAllDevice(Integer current){
        QueryWrapper<DigitalDevice> wrapper=new QueryWrapper<>();

        IPage<DigitalDevice> resultPage= mapper.selectPage(new Page<DigitalDevice>(current,20),wrapper);
        List<DigitalDevice> deviceList = resultPage.getRecords();
        return (List<DigitalDevice>) deviceList;
    }




}
